//创建类
class City {
  //成员变量(创建时直接给初始值,要么在构造函数给赋值)
  ccName: string = "";
  cclevel: number = 1;
  //给成员变量赋值
  constructor(name: string, level: number) {
    this.ccName = name;
    this.cclevel = level;
  }
  //成员方法
  ccabout() {
    console.log(
      `welcome ${this.ccName},this is place is too danger${this.cclevel}`
    );
  }
}
//创建方法
let c1 = new City("p城", 5);
console.log(c1.ccName);
console.log(c1.ccabout());
